package cn.cau.epidemicsurveysystem.service.impl;

import cn.cau.epidemicsurveysystem.bean.KnowledgeBean;
import cn.cau.epidemicsurveysystem.dao.KnowledgeRepository;
import cn.cau.epidemicsurveysystem.service.KnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @projectName: gp2023
 * @package: cn.cau.epidemicsurveysystem.service.impl
 * @className: KnowledgeServiceImpl
 * @author: zy
 * @description: knowledge服务实现类
 * @date: 2022/3/2 16:42
 * @version: 1.0
 */

@Service
public class KnowledgeServiceImpl implements KnowledgeService {
    @Autowired
    KnowledgeRepository knowledgeRepository;

    @Override
    public List<KnowledgeBean> getAllKnowledge() {
        return knowledgeRepository.findALl();
    }

    @Override
    public KnowledgeBean getKnowledgeById(int id) {
        return knowledgeRepository.findKnowledgeBeanByKnowledgeIdEquals(id);
    }
}
